package com.fw.ui.view.profile;

import static org.springframework.beans.factory.config.BeanDefinition.SCOPE_PROTOTYPE;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;

import com.fw.service.bean.EntryBean;
import com.fw.service.file.bean.FileBean;
import com.fw.service.merchantprofile.bean.MerchantProfileBean;
import com.fw.ui.bao.FileBAO;
import com.fw.ui.bao.MasterDataBAO;
import com.fw.ui.bao.MerchantProfileBAO;
import com.fw.ui.bao.MessageBAO;
import com.fw.ui.bao.PropertyBAO;
import com.fw.ui.core.ViewDescription;
import com.fw.ui.util.UICommonUtils;
import com.fw.ui.util.VaadinApplicationObjectSupport;
import com.fw.ui.view.AbstractView;
import com.fw.ui.view.common.util.ImageStreamSource;
import com.fw.ui.view.profile.merchant.event.DeleteMerchantProfileCancelButtonClickListener;
import com.fw.ui.view.profile.merchant.event.DeleteMerchantProfileDeleteButtonClickListener;
import com.vaadin.server.Page;
import com.vaadin.server.StreamResource;
import com.vaadin.server.VaadinService;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Image;
import com.vaadin.ui.Label;
import com.vaadin.ui.Notification;
import com.vaadin.ui.Panel;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;

@org.springframework.stereotype.Component
@Scope(SCOPE_PROTOTYPE)
@ViewDescription(name = "profile-merchant-delete", path = "/profile/merchant/delete")
public class DeleteMerchantProfileView extends AbstractView {

    private static final long serialVersionUID = 1L;

    public static final String DELETE_MERCHANT_PROFILE_MERCHANT_ID_REQUEST_ATTRIBUTE = "DELETE_MERCHANT_PROFILE_MERCHANT_ID_REQUEST_ATTRIBUTE";

    @Autowired
    protected transient VaadinApplicationObjectSupport app;

    @Autowired
    private MerchantProfileBAO merchantProfileBAO;
    @Autowired
    private MasterDataBAO masterDataBAO;
    @Autowired
    private MessageBAO messageBAO;
    @Autowired
    private PropertyBAO propertyBAO;
    @Autowired
    private FileBAO fileBAO;
    @Autowired
    private UICommonUtils uiCommonUtils;

    /**
     * BEAN
     */
    private MerchantProfileBean merchantProfileBean = new MerchantProfileBean();

    /**
     * EVENT
     */
    @Autowired
    private DeleteMerchantProfileCancelButtonClickListener deleteMerchantProfileCancelButtonClickListener;
    @Autowired
    private DeleteMerchantProfileDeleteButtonClickListener deleteMerchantProfileDeleteButtonClickListener;

    /**
     * COMPONENT
     */
    private Panel deleteMerchantProfilePanel = new Panel();
    private Panel merchantInformationPanel = new Panel();
    private Panel merchantGroupContactPersonPanel = new Panel();

    private Label lblMerchantLogoHint = new Label("", ContentMode.HTML);
    private Label lblMerchantLogo = new Label("", ContentMode.HTML);
    private Label lblMerchantId = new Label("", ContentMode.HTML);
    private Label lblStatus = new Label("", ContentMode.HTML);
    private Label lblMerchantNameEn = new Label("", ContentMode.HTML);
    private Label lblCompanyNameEn = new Label("", ContentMode.HTML);
    private Label lblMerchantNameTh = new Label("", ContentMode.HTML);
    private Label lblCompanyNameTh = new Label("", ContentMode.HTML);
    private Label lblMerchantServiceType = new Label("", ContentMode.HTML);
    private Label lblMCCCode = new Label("", ContentMode.HTML);
    private Label lblStatementName = new Label("", ContentMode.HTML);
    private Label lblBusinessRegistrationNumber = new Label("", ContentMode.HTML);
    private Label lblCountryRegion = new Label("", ContentMode.HTML);
    private Label lblCountryDomicile = new Label("", ContentMode.HTML);
    private Label lblMailingAddress = new Label("", ContentMode.HTML);
    private Label lblBusinessAddress = new Label("", ContentMode.HTML);
    private Label lblFaxNumber = new Label("", ContentMode.HTML);
    private Label lblUrl = new Label("", ContentMode.HTML);
    private Label lblEnquiryNumber = new Label("", ContentMode.HTML);
    private Label lblTaxId = new Label("", ContentMode.HTML);
    private Label lblIsTestMerchant = new Label("", ContentMode.HTML);
    private Label lblBlank = new Label("", ContentMode.HTML);

    private Label lblProjectTitle = new Label("", ContentMode.HTML);
    private Label lblProjectContactName = new Label("", ContentMode.HTML);
    private Label lblProjectContactEmailAddress = new Label("", ContentMode.HTML);
    private Label lblProjectContactPhone = new Label("", ContentMode.HTML);
    private Label lblProjectContactMobile = new Label("", ContentMode.HTML);

    private Label lblOperationTitle = new Label("", ContentMode.HTML);
    private Label lblOperationContactName = new Label("", ContentMode.HTML);
    private Label lblOperationContactEmailAddress = new Label("", ContentMode.HTML);
    private Label lblOperationContactPhone = new Label("", ContentMode.HTML);
    private Label lblOperationContactMobile = new Label("", ContentMode.HTML);

    private Label lblTechnicalTitle = new Label("", ContentMode.HTML);
    private Label lblTechnicalContactName = new Label("", ContentMode.HTML);
    private Label lblTechnicalContactEmailAddress = new Label("", ContentMode.HTML);
    private Label lblTechnicalContactPhone = new Label("", ContentMode.HTML);
    private Label lblTechnicalContactMobile = new Label("", ContentMode.HTML);

    private Label lblFinancialTitle = new Label("", ContentMode.HTML);
    private Label lblFinancialContactName = new Label("", ContentMode.HTML);
    private Label lblFinancialContactEmailAddress = new Label("", ContentMode.HTML);
    private Label lblFinancialContactPhone = new Label("", ContentMode.HTML);
    private Label lblFinancialContactMobile = new Label("", ContentMode.HTML);

    private Image imgMerchantLogo = new Image();
    private TextField txtMerchantId = new TextField();
    private ComboBox cbbStatus = new ComboBox();
    private TextField txtMerchantNameEn = new TextField();
    private TextField txtCompanyNameEn = new TextField();
    private TextField txtMerchantNameTh = new TextField();
    private TextField txtCompanyNameTh = new TextField();
    private ComboBox cbbMerchantServiceType = new ComboBox();
    private ComboBox cbbMCCCode = new ComboBox();
    private TextField txtStatementName = new TextField();
    private TextField txtBusinessRegistrationNumber = new TextField();
    private ComboBox cbbCountryRegion = new ComboBox();
    private ComboBox cbbCountryDomicile = new ComboBox();
    private TextField txtMailingAddress = new TextField();
    private TextField txtBusinessAddress = new TextField();
    private TextField txtFaxNumber = new TextField();
    private TextField txtUrl = new TextField();
    private TextField txtEnquiryNumber = new TextField();
    private TextField txtTaxId = new TextField();
    private CheckBox cbIsTestMerchant = new CheckBox();

    private TextField txtProjectContactName = new TextField();
    private TextArea txtProjectContactEmailAddress = new TextArea();
    private TextField txtProjectContactPhone = new TextField();
    private TextField txtProjectContactMobile = new TextField();

    private TextField txtOperationContactName = new TextField();
    private TextArea txtOperationContactEmailAddress = new TextArea();
    private TextField txtOperationContactPhone = new TextField();
    private TextField txtOperationContactMobile = new TextField();

    private TextField txtTechnicalContactName = new TextField();
    private TextArea txtTechnicalContactEmailAddress = new TextArea();
    private TextField txtTechnicalContactPhone = new TextField();
    private TextField txtTechnicalContactMobile = new TextField();

    private TextField txtFinancialContactName = new TextField();
    private TextArea txtFinancialContactEmailAddress = new TextArea();
    private TextField txtFinancialContactPhone = new TextField();
    private TextField txtFinancialContactMobile = new TextField();

    private HorizontalLayout layoutLogo = new HorizontalLayout();

    private Label lblConfirmDeleteMessage = new Label("", ContentMode.HTML);

    private Button btnDelete = new Button();
    private Button btnCancel = new Button();

    @Override
    public void updateStrings() {
	deleteMerchantProfilePanel.setCaption(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.title"));
	merchantInformationPanel.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.merchantInformationPanel.title"));
	merchantGroupContactPersonPanel.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.merchantGroupContactPersonPanel.title"));

	lblMerchantLogoHint.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.merchantLogoHint"));
	lblMerchantLogo.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.merchantLogo"));
	lblMerchantId.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.merchantId"));
	lblStatus.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.status"));
	lblMerchantNameEn.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.merchantNameEN"));
	lblCompanyNameEn.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.companyNameEN"));
	lblMerchantNameTh.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.merchantNameTH"));
	lblCompanyNameTh.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.companyNameTH"));
	lblMerchantServiceType.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.merchantServiceType"));
	lblMCCCode.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.mccCode"));
	lblStatementName.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.statementName"));
	lblBusinessRegistrationNumber.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.businessRegistrationNumber"));
	lblCountryRegion.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.countryRegion"));
	lblCountryDomicile.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.countryDomicile"));
	lblMailingAddress.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.mailingAddress"));
	lblBusinessAddress.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.businessAddress"));
	lblFaxNumber.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.faxNumber"));
	lblUrl.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.url"));
	lblEnquiryNumber.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.enquiryNumber"));
	lblTaxId.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.taxId"));
	lblIsTestMerchant.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.isTestMerchant"));

	lblProjectTitle.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.project"));
	lblProjectContactName.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.name"));
	lblProjectContactEmailAddress.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.email"));
	lblProjectContactPhone.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.phone"));
	lblProjectContactMobile.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.mobile"));

	lblOperationTitle.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.operation"));
	lblOperationContactName.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.name"));
	lblOperationContactEmailAddress.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.email"));
	lblOperationContactPhone.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.phone"));
	lblOperationContactMobile.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.mobile"));

	lblTechnicalTitle.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.technical"));
	lblTechnicalContactName.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.name"));
	lblTechnicalContactEmailAddress.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.email"));
	lblTechnicalContactPhone.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.phone"));
	lblTechnicalContactMobile.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.mobile"));

	lblFinancialTitle.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.financial"));
	lblFinancialContactName.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.name"));
	lblFinancialContactEmailAddress.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.email"));
	lblFinancialContactPhone.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.phone"));
	lblFinancialContactMobile.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.contact.mobile"));

	this.cbbStatus.setInputPrompt(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.inputprompt.status"));
	this.cbbMerchantServiceType.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.inputprompt.merchantServiceType"));
	this.cbbMCCCode.setInputPrompt(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.inputprompt.mccCode"));
	this.cbbCountryRegion.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.inputprompt.countryRegion"));
	this.cbbCountryDomicile.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.inputprompt.countryDomicile"));

	this.btnCancel.setCaption(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.button.cancel"));
	this.btnDelete.setCaption(this.messageBAO.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.button.delete"));

	this.lblConfirmDeleteMessage.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.DeleteMerchantProfileView.label.confirmdelete"));

    }

    @Override
    public void init() {
	this.setSizeFull();

	this.deleteMerchantProfilePanel.setSizeFull();
	this.deleteMerchantProfilePanel.setId("deleteMerchantProfilePanel");

	merchantInformationPanel.setId("deleteMerchantProfilePanel");
	merchantInformationPanel.setSizeFull();
	merchantInformationPanel.addStyleName("panel-caption-small");

	merchantGroupContactPersonPanel.setId("merchantGroupContactPersonPanel");
	merchantGroupContactPersonPanel.setSizeFull();
	merchantGroupContactPersonPanel.addStyleName("panel-caption-small");

	Label lblSepInformationCol1Row1 = new Label();
	Label lblSepInformationCol1Row2 = new Label();
	Label lblSepInformationCol1Row3 = new Label();
	Label lblSepInformationCol1Row4 = new Label();
	Label lblSepInformationCol1Row5 = new Label();
	Label lblSepInformationCol1Row6 = new Label();
	Label lblSepInformationCol1Row7 = new Label();
	Label lblSepInformationCol1Row8 = new Label();
	Label lblSepInformationCol1Row9 = new Label();
	Label lblSepInformationCol1Row10 = new Label();

	Label lblSepInformationContactCol1Row1 = new Label();
	Label lblSepInformationContactCol1Row2 = new Label();
	Label lblSepInformationContactCol1Row3 = new Label();
	Label lblSepInformationContactCol1Row4 = new Label();
	Label lblSepInformationContactCol1Row5 = new Label();
	Label lblSepInformationContactCol1Row6 = new Label();
	Label lblSepInformationContactCol1Row7 = new Label();
	Label lblSepInformationContactCol1Row8 = new Label();

	Label lblSepInformationCol2Row1 = new Label();
	Label lblSepInformationCol2Row2 = new Label();
	Label lblSepInformationCol2Row3 = new Label();
	Label lblSepInformationCol2Row4 = new Label();
	Label lblSepInformationCol2Row5 = new Label();
	Label lblSepInformationCol2Row6 = new Label();
	Label lblSepInformationCol2Row7 = new Label();
	Label lblSepInformationCol2Row8 = new Label();
	Label lblSepInformationCol2Row9 = new Label();
	Label lblSepInformationCol2Row10 = new Label();

	Label lblSepInformationContactCol2Row1 = new Label();
	Label lblSepInformationContactCol2Row2 = new Label();
	Label lblSepInformationContactCol2Row3 = new Label();
	Label lblSepInformationContactCol2Row4 = new Label();
	Label lblSepInformationContactCol2Row5 = new Label();
	Label lblSepInformationContactCol2Row6 = new Label();
	Label lblSepInformationContactCol2Row7 = new Label();
	Label lblSepInformationContactCol2Row8 = new Label();

	lblSepInformationCol1Row1.setWidth("200px");
	lblSepInformationCol1Row2.setWidth("200px");
	lblSepInformationCol1Row3.setWidth("200px");
	lblSepInformationCol1Row4.setWidth("200px");
	lblSepInformationCol1Row5.setWidth("200px");
	lblSepInformationCol1Row6.setWidth("200px");
	lblSepInformationCol1Row7.setWidth("200px");
	lblSepInformationCol1Row8.setWidth("200px");
	lblSepInformationCol1Row9.setWidth("200px");
	lblSepInformationCol1Row10.setWidth("200px");

	lblSepInformationContactCol1Row1.setWidth("200px");
	lblSepInformationContactCol1Row2.setWidth("200px");
	lblSepInformationContactCol1Row3.setWidth("200px");
	lblSepInformationContactCol1Row4.setWidth("200px");
	lblSepInformationContactCol1Row5.setWidth("200px");
	lblSepInformationContactCol1Row6.setWidth("200px");
	lblSepInformationContactCol1Row7.setWidth("200px");
	lblSepInformationContactCol1Row8.setWidth("200px");

	lblSepInformationCol2Row1.setWidth("200px");
	lblSepInformationCol2Row2.setWidth("200px");
	lblSepInformationCol2Row3.setWidth("200px");
	lblSepInformationCol2Row4.setWidth("200px");
	lblSepInformationCol2Row5.setWidth("200px");
	lblSepInformationCol2Row6.setWidth("200px");
	lblSepInformationCol2Row7.setWidth("200px");
	lblSepInformationCol2Row8.setWidth("200px");
	lblSepInformationCol2Row9.setWidth("200px");
	lblSepInformationCol2Row10.setWidth("200px");

	lblSepInformationContactCol2Row1.setWidth("200px");
	lblSepInformationContactCol2Row2.setWidth("200px");
	lblSepInformationContactCol2Row3.setWidth("200px");
	lblSepInformationContactCol2Row4.setWidth("200px");
	lblSepInformationContactCol2Row5.setWidth("200px");
	lblSepInformationContactCol2Row6.setWidth("200px");
	lblSepInformationContactCol2Row7.setWidth("200px");
	lblSepInformationContactCol2Row8.setWidth("200px");

	layoutLogo.setWidth("300px");
	layoutLogo.setHeight("150px");
	layoutLogo.addComponent(lblMerchantLogoHint);
	layoutLogo.addComponent(imgMerchantLogo);
	layoutLogo.setComponentAlignment(lblMerchantLogoHint, Alignment.MIDDLE_CENTER);
	layoutLogo.setComponentAlignment(imgMerchantLogo, Alignment.MIDDLE_CENTER);
	imgMerchantLogo.setVisible(false);

	layoutLogo.addStyleName("box-layout");

	lblMerchantId.setWidth("200px");
	lblStatus.setWidth("200px");
	lblMerchantNameEn.setWidth("200px");
	lblCompanyNameEn.setWidth("200px");
	lblMerchantNameTh.setWidth("200px");
	lblCompanyNameTh.setWidth("200px");
	lblMerchantServiceType.setWidth("200px");
	lblMCCCode.setWidth("200px");
	lblStatementName.setWidth("200px");
	lblBusinessRegistrationNumber.setWidth("200px");
	lblCountryRegion.setWidth("200px");
	lblCountryDomicile.setWidth("200px");
	lblMailingAddress.setWidth("200px");
	lblBusinessAddress.setWidth("200px");
	lblFaxNumber.setWidth("200px");
	lblUrl.setWidth("200px");
	lblEnquiryNumber.setWidth("200px");
	lblTaxId.setWidth("200px");
	lblIsTestMerchant.setWidth("200px");

	lblProjectTitle.setWidth("200px");
	lblProjectContactName.setWidth("200px");
	lblProjectContactEmailAddress.setWidth("200px");
	lblProjectContactPhone.setWidth("200px");
	lblProjectContactMobile.setWidth("200px");

	lblOperationTitle.setWidth("200px");
	lblOperationContactName.setWidth("200px");
	lblOperationContactEmailAddress.setWidth("200px");
	lblOperationContactPhone.setWidth("200px");
	lblOperationContactMobile.setWidth("200px");

	lblTechnicalTitle.setWidth("200px");
	lblTechnicalContactName.setWidth("200px");
	lblTechnicalContactEmailAddress.setWidth("200px");
	lblTechnicalContactPhone.setWidth("200px");
	lblTechnicalContactMobile.setWidth("200px");

	lblFinancialTitle.setWidth("200px");
	lblFinancialContactName.setWidth("200px");
	lblFinancialContactEmailAddress.setWidth("200px");
	lblFinancialContactPhone.setWidth("200px");
	lblFinancialContactMobile.setWidth("200px");

	txtMerchantId.setWidth("200px");
	cbbStatus.setWidth("200px");
	txtMerchantNameEn.setWidth("200px");
	txtCompanyNameEn.setWidth("200px");
	txtMerchantNameTh.setWidth("200px");
	txtCompanyNameTh.setWidth("200px");
	cbbMerchantServiceType.setWidth("200px");
	cbbMCCCode.setWidth("200px");
	txtStatementName.setWidth("200px");
	txtBusinessRegistrationNumber.setWidth("200px");
	cbbCountryRegion.setWidth("200px");
	cbbCountryDomicile.setWidth("200px");
	txtMailingAddress.setWidth("200px");
	txtBusinessAddress.setWidth("200px");
	txtFaxNumber.setWidth("200px");
	txtUrl.setWidth("200px");
	txtEnquiryNumber.setWidth("200px");
	txtTaxId.setWidth("200px");
	cbIsTestMerchant.setWidth("200px");

	txtProjectContactName.setWidth("200px");
	txtProjectContactEmailAddress.setWidth("200px");
	txtProjectContactPhone.setWidth("200px");
	txtProjectContactMobile.setWidth("200px");

	txtOperationContactName.setWidth("200px");
	txtOperationContactEmailAddress.setWidth("200px");
	txtOperationContactPhone.setWidth("200px");
	txtOperationContactMobile.setWidth("200px");

	txtTechnicalContactName.setWidth("200px");
	txtTechnicalContactEmailAddress.setWidth("200px");
	txtTechnicalContactPhone.setWidth("200px");
	txtTechnicalContactMobile.setWidth("200px");

	txtFinancialContactName.setWidth("200px");
	txtFinancialContactEmailAddress.setWidth("200px");
	txtFinancialContactPhone.setWidth("200px");
	txtFinancialContactMobile.setWidth("200px");

	this.lblConfirmDeleteMessage.addStyleName("label-red");

	this.btnCancel.setId("btnCancel" + UICommonUtils.EXCLUDE_ENABLE_COMPONENT_PREFIX);
	this.btnCancel.addStyleName("button-blue");
	this.btnCancel.setDisableOnClick(true);
	this.btnCancel.setWidth("70px");

	this.btnDelete.setId("btnDelete" + UICommonUtils.EXCLUDE_ENABLE_COMPONENT_PREFIX);
	this.btnDelete.addStyleName("button-red");
	this.btnDelete.setDisableOnClick(true);
	this.btnDelete.setWidth("70px");

	VerticalLayout mainLayout = new VerticalLayout();
	mainLayout.setSizeFull();
	mainLayout.setSizeUndefined();
	mainLayout.setWidth("100%");

	VerticalLayout informationLayout = new VerticalLayout();
	informationLayout.setSizeFull();
	informationLayout.setSizeUndefined();
	informationLayout.setSpacing(true);
	informationLayout.setWidth("100%");

	VerticalLayout contactLayout = new VerticalLayout();
	contactLayout.setSizeFull();
	contactLayout.setSizeUndefined();
	contactLayout.setSpacing(true);
	contactLayout.setWidth("100%");

	HorizontalLayout commandLayout = new HorizontalLayout();
	commandLayout.setSizeUndefined();
	commandLayout.setSpacing(true);

	this.merchantInformationPanel.setContent(informationLayout);
	this.merchantGroupContactPersonPanel.setContent(contactLayout);
	this.deleteMerchantProfilePanel.setContent(mainLayout);

	VerticalLayout formInformationLayout = new VerticalLayout();
	formInformationLayout.setId("formInformationLayout");
	formInformationLayout.setSizeUndefined();
	formInformationLayout.setWidth("100%");
	formInformationLayout.setSpacing(true);

	HorizontalLayout informationRow0 = new HorizontalLayout();
	HorizontalLayout informationRow1 = new HorizontalLayout();
	HorizontalLayout informationRow2 = new HorizontalLayout();
	HorizontalLayout informationRow3 = new HorizontalLayout();
	HorizontalLayout informationRow4 = new HorizontalLayout();
	HorizontalLayout informationRow5 = new HorizontalLayout();
	HorizontalLayout informationRow6 = new HorizontalLayout();

	informationRow1.setSpacing(true);
	informationRow2.setSpacing(true);
	informationRow3.setSpacing(true);
	informationRow4.setSpacing(true);
	informationRow5.setSpacing(true);

	informationRow1.setSizeUndefined();
	informationRow2.setSizeUndefined();
	informationRow3.setSizeUndefined();
	informationRow4.setSizeUndefined();
	informationRow5.setSizeUndefined();

	VerticalLayout informationCol1Layout = new VerticalLayout();
	VerticalLayout informationCol2Layout = new VerticalLayout();

	informationCol1Layout.setSizeUndefined();
	informationCol1Layout.setWidth("100%");
	informationCol1Layout.setSpacing(true);

	informationCol2Layout.setSizeUndefined();
	informationCol2Layout.setWidth("100%");
	informationCol2Layout.setSpacing(true);

	HorizontalLayout informationCol1Row1 = new HorizontalLayout();
	HorizontalLayout informationCol1Row2 = new HorizontalLayout();
	HorizontalLayout informationCol1Row3 = new HorizontalLayout();
	HorizontalLayout informationCol1Row4 = new HorizontalLayout();
	HorizontalLayout informationCol1Row5 = new HorizontalLayout();
	HorizontalLayout informationCol1Row6 = new HorizontalLayout();
	HorizontalLayout informationCol1Row7 = new HorizontalLayout();
	HorizontalLayout informationCol1Row8 = new HorizontalLayout();
	HorizontalLayout informationCol1Row9 = new HorizontalLayout();
	HorizontalLayout informationCol1Row0 = new HorizontalLayout();

	HorizontalLayout informationCol2Row1 = new HorizontalLayout();
	HorizontalLayout informationCol2Row2 = new HorizontalLayout();
	HorizontalLayout informationCol2Row3 = new HorizontalLayout();
	HorizontalLayout informationCol2Row4 = new HorizontalLayout();
	HorizontalLayout informationCol2Row5 = new HorizontalLayout();
	HorizontalLayout informationCol2Row6 = new HorizontalLayout();
	HorizontalLayout informationCol2Row7 = new HorizontalLayout();
	HorizontalLayout informationCol2Row8 = new HorizontalLayout();
	HorizontalLayout informationCol2Row9 = new HorizontalLayout();
	HorizontalLayout informationCol2Row0 = new HorizontalLayout();

	informationCol1Row1.setSpacing(true);
	informationCol1Row2.setSpacing(true);
	informationCol1Row3.setSpacing(true);
	informationCol1Row4.setSpacing(true);
	informationCol1Row5.setSpacing(true);
	informationCol1Row6.setSpacing(true);
	informationCol1Row7.setSpacing(true);
	informationCol1Row8.setSpacing(true);
	informationCol1Row9.setSpacing(true);
	informationCol1Row0.setSpacing(true);

	informationCol1Row1.setSizeUndefined();
	informationCol1Row2.setSizeUndefined();
	informationCol1Row3.setSizeUndefined();
	informationCol1Row4.setSizeUndefined();
	informationCol1Row5.setSizeUndefined();
	informationCol1Row6.setSizeUndefined();
	informationCol1Row7.setSizeUndefined();
	informationCol1Row8.setSizeUndefined();
	informationCol1Row9.setSizeUndefined();
	informationCol1Row0.setSizeUndefined();

	informationCol2Row1.setSpacing(true);
	informationCol2Row2.setSpacing(true);
	informationCol2Row3.setSpacing(true);
	informationCol2Row4.setSpacing(true);
	informationCol2Row5.setSpacing(true);
	informationCol2Row6.setSpacing(true);
	informationCol2Row7.setSpacing(true);
	informationCol2Row8.setSpacing(true);
	informationCol2Row9.setSpacing(true);
	informationCol2Row0.setSpacing(true);

	informationCol2Row1.setSizeUndefined();
	informationCol2Row2.setSizeUndefined();
	informationCol2Row3.setSizeUndefined();
	informationCol2Row4.setSizeUndefined();
	informationCol2Row5.setSizeUndefined();
	informationCol2Row6.setSizeUndefined();
	informationCol2Row7.setSizeUndefined();
	informationCol2Row8.setSizeUndefined();
	informationCol2Row9.setSizeUndefined();
	informationCol2Row0.setSizeUndefined();

	informationCol1Row1.addComponent(lblMerchantId);
	informationCol1Row1.addComponent(txtMerchantId);
	informationCol1Row1.setComponentAlignment(lblMerchantId, Alignment.MIDDLE_LEFT);
	informationCol1Row1.setComponentAlignment(txtMerchantId, Alignment.MIDDLE_LEFT);

	informationCol1Row2.addComponent(lblMerchantNameEn);
	informationCol1Row2.addComponent(txtMerchantNameEn);
	informationCol1Row2.setComponentAlignment(lblMerchantNameEn, Alignment.MIDDLE_LEFT);
	informationCol1Row2.setComponentAlignment(txtMerchantNameEn, Alignment.MIDDLE_LEFT);

	informationCol1Row3.addComponent(lblCompanyNameEn);
	informationCol1Row3.addComponent(txtCompanyNameEn);
	informationCol1Row3.setComponentAlignment(lblCompanyNameEn, Alignment.MIDDLE_LEFT);
	informationCol1Row3.setComponentAlignment(txtCompanyNameEn, Alignment.MIDDLE_LEFT);

	informationCol1Row4.addComponent(lblMerchantServiceType);
	informationCol1Row4.addComponent(cbbMerchantServiceType);
	informationCol1Row4.setComponentAlignment(lblMerchantServiceType, Alignment.MIDDLE_LEFT);
	informationCol1Row4.setComponentAlignment(cbbMerchantServiceType, Alignment.MIDDLE_LEFT);

	informationCol1Row5.addComponent(lblBusinessRegistrationNumber);
	informationCol1Row5.addComponent(txtBusinessRegistrationNumber);
	informationCol1Row5.setComponentAlignment(lblBusinessRegistrationNumber, Alignment.MIDDLE_LEFT);
	informationCol1Row5.setComponentAlignment(txtBusinessRegistrationNumber, Alignment.MIDDLE_LEFT);

	informationCol1Row6.addComponent(lblCountryDomicile);
	informationCol1Row6.addComponent(cbbCountryDomicile);
	informationCol1Row6.setComponentAlignment(lblCountryDomicile, Alignment.MIDDLE_LEFT);
	informationCol1Row6.setComponentAlignment(cbbCountryDomicile, Alignment.MIDDLE_LEFT);

	informationCol1Row7.addComponent(lblBusinessAddress);
	informationCol1Row7.addComponent(txtBusinessAddress);
	informationCol1Row7.setComponentAlignment(lblBusinessAddress, Alignment.MIDDLE_LEFT);
	informationCol1Row7.setComponentAlignment(txtBusinessAddress, Alignment.MIDDLE_LEFT);

	informationCol1Row8.addComponent(lblUrl);
	informationCol1Row8.addComponent(txtUrl);
	informationCol1Row8.setComponentAlignment(lblUrl, Alignment.MIDDLE_LEFT);
	informationCol1Row8.setComponentAlignment(txtUrl, Alignment.MIDDLE_LEFT);

	informationCol1Row9.addComponent(lblTaxId);
	informationCol1Row9.addComponent(txtTaxId);
	informationCol1Row9.setComponentAlignment(lblTaxId, Alignment.MIDDLE_LEFT);
	informationCol1Row9.setComponentAlignment(txtTaxId, Alignment.MIDDLE_LEFT);

	informationCol1Row0.addComponent(lblIsTestMerchant);
	informationCol1Row0.addComponent(cbIsTestMerchant);
	informationCol1Row0.setComponentAlignment(lblIsTestMerchant, Alignment.MIDDLE_LEFT);
	informationCol1Row0.setComponentAlignment(cbIsTestMerchant, Alignment.MIDDLE_LEFT);

	informationCol2Row1.addComponent(lblStatus);
	informationCol2Row1.addComponent(cbbStatus);
	informationCol2Row1.setComponentAlignment(lblStatus, Alignment.MIDDLE_LEFT);
	informationCol2Row1.setComponentAlignment(cbbStatus, Alignment.MIDDLE_LEFT);

	informationCol2Row2.addComponent(lblMerchantNameTh);
	informationCol2Row2.addComponent(txtMerchantNameTh);
	informationCol2Row2.setComponentAlignment(lblMerchantNameTh, Alignment.MIDDLE_LEFT);
	informationCol2Row2.setComponentAlignment(txtMerchantNameTh, Alignment.MIDDLE_LEFT);

	informationCol2Row3.addComponent(lblCompanyNameTh);
	informationCol2Row3.addComponent(txtCompanyNameTh);
	informationCol2Row3.setComponentAlignment(lblCompanyNameTh, Alignment.MIDDLE_LEFT);
	informationCol2Row3.setComponentAlignment(txtCompanyNameTh, Alignment.MIDDLE_LEFT);

	informationCol2Row4.addComponent(lblMCCCode);
	informationCol2Row4.addComponent(cbbMCCCode);
	informationCol2Row4.setComponentAlignment(lblMCCCode, Alignment.MIDDLE_LEFT);
	informationCol2Row4.setComponentAlignment(cbbMCCCode, Alignment.MIDDLE_LEFT);

	informationCol2Row5.addComponent(lblStatementName);
	informationCol2Row5.addComponent(txtStatementName);
	informationCol2Row5.setComponentAlignment(lblStatementName, Alignment.MIDDLE_LEFT);
	informationCol2Row5.setComponentAlignment(txtStatementName, Alignment.MIDDLE_LEFT);

	informationCol2Row6.addComponent(lblCountryRegion);
	informationCol2Row6.addComponent(cbbCountryRegion);
	informationCol2Row6.setComponentAlignment(lblCountryRegion, Alignment.MIDDLE_LEFT);
	informationCol2Row6.setComponentAlignment(cbbCountryRegion, Alignment.MIDDLE_LEFT);

	informationCol2Row7.addComponent(lblMailingAddress);
	informationCol2Row7.addComponent(txtMailingAddress);
	informationCol2Row7.setComponentAlignment(lblMailingAddress, Alignment.MIDDLE_LEFT);
	informationCol2Row7.setComponentAlignment(txtMailingAddress, Alignment.MIDDLE_LEFT);

	informationCol2Row8.addComponent(lblFaxNumber);
	informationCol2Row8.addComponent(txtFaxNumber);
	informationCol2Row8.setComponentAlignment(lblFaxNumber, Alignment.MIDDLE_LEFT);
	informationCol2Row8.setComponentAlignment(txtFaxNumber, Alignment.MIDDLE_LEFT);

	informationCol2Row9.addComponent(lblEnquiryNumber);
	informationCol2Row9.addComponent(txtEnquiryNumber);
	informationCol2Row9.setComponentAlignment(lblEnquiryNumber, Alignment.MIDDLE_LEFT);
	informationCol2Row9.setComponentAlignment(txtEnquiryNumber, Alignment.MIDDLE_LEFT);

	lblBlank.setHeight("19px");
	informationCol2Row0.setHeight("19px");
	informationCol2Row0.addComponent(lblBlank);
	informationCol2Row0.addComponent(lblBlank);
	informationCol2Row0.setComponentAlignment(lblBlank, Alignment.MIDDLE_LEFT);
	informationCol2Row0.setComponentAlignment(lblBlank, Alignment.MIDDLE_LEFT);

	informationCol1Layout.addComponent(informationCol1Row0);
	informationCol1Layout.addComponent(informationCol1Row1);
	informationCol1Layout.addComponent(informationCol1Row2);
	informationCol1Layout.addComponent(informationCol1Row3);
	informationCol1Layout.addComponent(informationCol1Row4);
	informationCol1Layout.addComponent(informationCol1Row5);
	informationCol1Layout.addComponent(informationCol1Row6);
	informationCol1Layout.addComponent(informationCol1Row7);
	informationCol1Layout.addComponent(informationCol1Row8);
	informationCol1Layout.addComponent(informationCol1Row9);

	informationCol2Layout.addComponent(informationCol2Row0);
	informationCol2Layout.addComponent(informationCol2Row1);
	informationCol2Layout.addComponent(informationCol2Row2);
	informationCol2Layout.addComponent(informationCol2Row3);
	informationCol2Layout.addComponent(informationCol2Row4);
	informationCol2Layout.addComponent(informationCol2Row5);
	informationCol2Layout.addComponent(informationCol2Row6);
	informationCol2Layout.addComponent(informationCol2Row7);
	informationCol2Layout.addComponent(informationCol2Row8);
	informationCol2Layout.addComponent(informationCol2Row9);

	informationRow1.addComponent(lblMerchantLogo);
	informationRow2.addComponent(layoutLogo);
	informationRow1.setComponentAlignment(lblMerchantLogo, Alignment.MIDDLE_CENTER);
	informationRow2.setComponentAlignment(layoutLogo, Alignment.MIDDLE_CENTER);

	Label lblSepInformationCol = new Label();
	lblSepInformationCol.setWidth("40px");

	informationRow5.addComponent(informationCol1Layout);
	informationRow5.addComponent(lblSepInformationCol);
	informationRow5.addComponent(informationCol2Layout);

	formInformationLayout.addComponent(informationRow0);
	formInformationLayout.addComponent(informationRow1);
	formInformationLayout.addComponent(informationRow2);
	formInformationLayout.addComponent(informationRow3);
	formInformationLayout.addComponent(informationRow4);
	formInformationLayout.addComponent(informationRow5);
	formInformationLayout.addComponent(informationRow6);

	formInformationLayout.setComponentAlignment(informationRow0, Alignment.MIDDLE_CENTER);
	formInformationLayout.setComponentAlignment(informationRow1, Alignment.MIDDLE_CENTER);
	formInformationLayout.setComponentAlignment(informationRow2, Alignment.MIDDLE_CENTER);
	formInformationLayout.setComponentAlignment(informationRow3, Alignment.MIDDLE_CENTER);
	formInformationLayout.setComponentAlignment(informationRow4, Alignment.MIDDLE_CENTER);
	formInformationLayout.setComponentAlignment(informationRow5, Alignment.MIDDLE_CENTER);

	informationLayout.addComponent(formInformationLayout);
	informationLayout.setComponentAlignment(formInformationLayout, Alignment.MIDDLE_CENTER);

	HorizontalLayout contactRow = new HorizontalLayout();
	contactRow.setSizeUndefined();
	contactRow.setSpacing(true);

	VerticalLayout contactCol1Layout = new VerticalLayout();
	VerticalLayout contactCol2Layout = new VerticalLayout();

	contactCol1Layout.setSizeUndefined();
	contactCol1Layout.setWidth("100%");
	contactCol1Layout.setSpacing(true);

	contactCol2Layout.setSizeUndefined();
	contactCol2Layout.setWidth("100%");
	contactCol2Layout.setSpacing(true);

	HorizontalLayout contactCol1Row1 = new HorizontalLayout();
	HorizontalLayout contactCol1Row2 = new HorizontalLayout();
	HorizontalLayout contactCol1Row3 = new HorizontalLayout();
	HorizontalLayout contactCol1Row4 = new HorizontalLayout();
	HorizontalLayout contactCol1Row5 = new HorizontalLayout();
	HorizontalLayout contactCol1Row6 = new HorizontalLayout();
	HorizontalLayout contactCol1Row7 = new HorizontalLayout();
	HorizontalLayout contactCol1Row8 = new HorizontalLayout();
	HorizontalLayout contactCol1Row9 = new HorizontalLayout();
	HorizontalLayout contactCol1Row10 = new HorizontalLayout();

	HorizontalLayout contactCol2Row1 = new HorizontalLayout();
	HorizontalLayout contactCol2Row2 = new HorizontalLayout();
	HorizontalLayout contactCol2Row3 = new HorizontalLayout();
	HorizontalLayout contactCol2Row4 = new HorizontalLayout();
	HorizontalLayout contactCol2Row5 = new HorizontalLayout();
	HorizontalLayout contactCol2Row6 = new HorizontalLayout();
	HorizontalLayout contactCol2Row7 = new HorizontalLayout();
	HorizontalLayout contactCol2Row8 = new HorizontalLayout();
	HorizontalLayout contactCol2Row9 = new HorizontalLayout();
	HorizontalLayout contactCol2Row10 = new HorizontalLayout();

	contactCol1Row1.setSpacing(true);
	contactCol1Row2.setSpacing(true);
	contactCol1Row3.setSpacing(true);
	contactCol1Row4.setSpacing(true);
	contactCol1Row5.setSpacing(true);
	contactCol1Row6.setSpacing(true);
	contactCol1Row7.setSpacing(true);
	contactCol1Row8.setSpacing(true);
	contactCol1Row9.setSpacing(true);
	contactCol1Row10.setSpacing(true);

	contactCol1Row1.setSizeUndefined();
	contactCol1Row2.setSizeUndefined();
	contactCol1Row3.setSizeUndefined();
	contactCol1Row4.setSizeUndefined();
	contactCol1Row5.setSizeUndefined();
	contactCol1Row6.setSizeUndefined();
	contactCol1Row7.setSizeUndefined();
	contactCol1Row8.setSizeUndefined();
	contactCol1Row9.setSizeUndefined();
	contactCol1Row10.setSizeUndefined();

	contactCol2Row1.setSpacing(true);
	contactCol2Row2.setSpacing(true);
	contactCol2Row3.setSpacing(true);
	contactCol2Row4.setSpacing(true);
	contactCol2Row5.setSpacing(true);
	contactCol2Row6.setSpacing(true);
	contactCol2Row7.setSpacing(true);
	contactCol2Row8.setSpacing(true);
	contactCol2Row9.setSpacing(true);
	contactCol2Row10.setSpacing(true);

	contactCol2Row1.setSizeUndefined();
	contactCol2Row2.setSizeUndefined();
	contactCol2Row3.setSizeUndefined();
	contactCol2Row4.setSizeUndefined();
	contactCol2Row5.setSizeUndefined();
	contactCol2Row6.setSizeUndefined();
	contactCol2Row7.setSizeUndefined();
	contactCol2Row8.setSizeUndefined();
	contactCol2Row9.setSizeUndefined();
	contactCol2Row10.setSizeUndefined();

	contactCol1Row1.addComponent(lblProjectTitle);
	contactCol1Row1.setComponentAlignment(lblProjectTitle, Alignment.MIDDLE_LEFT);

	contactCol1Row2.addComponent(lblProjectContactName);
	contactCol1Row2.addComponent(txtProjectContactName);
	contactCol1Row2.setComponentAlignment(lblProjectContactName, Alignment.MIDDLE_LEFT);
	contactCol1Row2.setComponentAlignment(txtProjectContactName, Alignment.MIDDLE_LEFT);

	contactCol1Row3.addComponent(lblProjectContactPhone);
	contactCol1Row3.addComponent(txtProjectContactPhone);
	contactCol1Row3.setComponentAlignment(lblProjectContactPhone, Alignment.MIDDLE_LEFT);
	contactCol1Row3.setComponentAlignment(txtProjectContactPhone, Alignment.MIDDLE_LEFT);

	contactCol1Row4.addComponent(lblProjectContactMobile);
	contactCol1Row4.addComponent(txtProjectContactMobile);
	contactCol1Row4.setComponentAlignment(lblProjectContactMobile, Alignment.MIDDLE_LEFT);
	contactCol1Row4.setComponentAlignment(txtProjectContactMobile, Alignment.MIDDLE_LEFT);

	contactCol1Row5.addComponent(lblProjectContactEmailAddress);
	contactCol1Row5.addComponent(txtProjectContactEmailAddress);
	contactCol1Row5.setComponentAlignment(lblProjectContactEmailAddress, Alignment.MIDDLE_LEFT);
	contactCol1Row5.setComponentAlignment(txtProjectContactEmailAddress, Alignment.MIDDLE_LEFT);

	contactCol1Row6.addComponent(lblTechnicalTitle);
	contactCol1Row6.setComponentAlignment(lblTechnicalTitle, Alignment.MIDDLE_LEFT);

	contactCol1Row7.addComponent(lblTechnicalContactName);
	contactCol1Row7.addComponent(txtTechnicalContactName);
	contactCol1Row7.setComponentAlignment(lblTechnicalContactName, Alignment.MIDDLE_LEFT);
	contactCol1Row7.setComponentAlignment(txtTechnicalContactName, Alignment.MIDDLE_LEFT);

	contactCol1Row8.addComponent(lblTechnicalContactPhone);
	contactCol1Row8.addComponent(txtTechnicalContactPhone);
	contactCol1Row8.setComponentAlignment(lblTechnicalContactPhone, Alignment.MIDDLE_LEFT);
	contactCol1Row8.setComponentAlignment(txtTechnicalContactPhone, Alignment.MIDDLE_LEFT);

	contactCol1Row9.addComponent(lblTechnicalContactMobile);
	contactCol1Row9.addComponent(txtTechnicalContactMobile);
	contactCol1Row9.setComponentAlignment(lblTechnicalContactMobile, Alignment.MIDDLE_LEFT);
	contactCol1Row9.setComponentAlignment(txtTechnicalContactMobile, Alignment.MIDDLE_LEFT);

	contactCol1Row10.addComponent(lblTechnicalContactEmailAddress);
	contactCol1Row10.addComponent(txtTechnicalContactEmailAddress);
	contactCol1Row10.setComponentAlignment(lblTechnicalContactEmailAddress, Alignment.MIDDLE_LEFT);
	contactCol1Row10.setComponentAlignment(txtTechnicalContactEmailAddress, Alignment.MIDDLE_LEFT);

	contactCol2Row1.addComponent(lblOperationTitle);
	contactCol2Row1.setComponentAlignment(lblOperationTitle, Alignment.MIDDLE_LEFT);

	contactCol2Row2.addComponent(lblOperationContactName);
	contactCol2Row2.addComponent(txtOperationContactName);
	contactCol2Row2.setComponentAlignment(lblOperationContactName, Alignment.MIDDLE_LEFT);
	contactCol2Row2.setComponentAlignment(txtOperationContactName, Alignment.MIDDLE_LEFT);

	contactCol2Row3.addComponent(lblOperationContactPhone);
	contactCol2Row3.addComponent(txtOperationContactPhone);
	contactCol2Row3.setComponentAlignment(lblOperationContactPhone, Alignment.MIDDLE_LEFT);
	contactCol2Row3.setComponentAlignment(txtOperationContactPhone, Alignment.MIDDLE_LEFT);

	contactCol2Row4.addComponent(lblOperationContactMobile);
	contactCol2Row4.addComponent(txtOperationContactMobile);
	contactCol2Row4.setComponentAlignment(lblOperationContactMobile, Alignment.MIDDLE_LEFT);
	contactCol2Row4.setComponentAlignment(txtOperationContactMobile, Alignment.MIDDLE_LEFT);

	contactCol2Row5.addComponent(lblOperationContactEmailAddress);
	contactCol2Row5.addComponent(txtOperationContactEmailAddress);
	contactCol2Row5.setComponentAlignment(lblOperationContactEmailAddress, Alignment.MIDDLE_LEFT);
	contactCol2Row5.setComponentAlignment(txtOperationContactEmailAddress, Alignment.MIDDLE_LEFT);

	contactCol2Row6.addComponent(lblFinancialTitle);
	contactCol2Row6.setComponentAlignment(lblFinancialTitle, Alignment.MIDDLE_LEFT);

	contactCol2Row7.addComponent(lblFinancialContactName);
	contactCol2Row7.addComponent(txtFinancialContactName);
	contactCol2Row7.setComponentAlignment(lblFinancialContactName, Alignment.MIDDLE_LEFT);
	contactCol2Row7.setComponentAlignment(txtFinancialContactName, Alignment.MIDDLE_LEFT);

	contactCol2Row8.addComponent(lblFinancialContactPhone);
	contactCol2Row8.addComponent(txtFinancialContactPhone);
	contactCol2Row8.setComponentAlignment(lblFinancialContactPhone, Alignment.MIDDLE_LEFT);
	contactCol2Row8.setComponentAlignment(txtFinancialContactPhone, Alignment.MIDDLE_LEFT);

	contactCol2Row9.addComponent(lblFinancialContactMobile);
	contactCol2Row9.addComponent(txtFinancialContactMobile);
	contactCol2Row9.setComponentAlignment(lblFinancialContactMobile, Alignment.MIDDLE_LEFT);
	contactCol2Row9.setComponentAlignment(txtFinancialContactMobile, Alignment.MIDDLE_LEFT);

	contactCol2Row10.addComponent(lblFinancialContactEmailAddress);
	contactCol2Row10.addComponent(txtFinancialContactEmailAddress);
	contactCol2Row10.setComponentAlignment(lblFinancialContactEmailAddress, Alignment.MIDDLE_LEFT);
	contactCol2Row10.setComponentAlignment(txtFinancialContactEmailAddress, Alignment.MIDDLE_LEFT);

	contactCol1Layout.addComponent(contactCol1Row1);
	contactCol1Layout.addComponent(contactCol1Row2);
	contactCol1Layout.addComponent(contactCol1Row3);
	contactCol1Layout.addComponent(contactCol1Row4);
	contactCol1Layout.addComponent(contactCol1Row5);
	contactCol1Layout.addComponent(new HorizontalLayout());
	contactCol1Layout.addComponent(contactCol1Row6);
	contactCol1Layout.addComponent(contactCol1Row7);
	contactCol1Layout.addComponent(contactCol1Row8);
	contactCol1Layout.addComponent(contactCol1Row9);
	contactCol1Layout.addComponent(contactCol1Row10);

	contactCol2Layout.addComponent(contactCol2Row1);
	contactCol2Layout.addComponent(contactCol2Row2);
	contactCol2Layout.addComponent(contactCol2Row3);
	contactCol2Layout.addComponent(contactCol2Row4);
	contactCol2Layout.addComponent(contactCol2Row5);
	contactCol2Layout.addComponent(new HorizontalLayout());
	contactCol2Layout.addComponent(contactCol2Row6);
	contactCol2Layout.addComponent(contactCol2Row7);
	contactCol2Layout.addComponent(contactCol2Row8);
	contactCol2Layout.addComponent(contactCol2Row9);
	contactCol2Layout.addComponent(contactCol2Row10);

	Label lblSepContactCol = new Label();
	lblSepContactCol.setWidth("40px");

	contactRow.addComponent(contactCol1Layout);
	contactRow.addComponent(lblSepContactCol);
	contactRow.addComponent(contactCol2Layout);

	contactLayout.addComponent(new HorizontalLayout());
	contactLayout.addComponent(contactRow);
	contactLayout.addComponent(new HorizontalLayout());
	contactLayout.setComponentAlignment(contactRow, Alignment.MIDDLE_CENTER);

	commandLayout.addComponent(btnDelete);
	commandLayout.addComponent(btnCancel);

	mainLayout.addComponent(merchantInformationPanel);
	mainLayout.addComponent(merchantGroupContactPersonPanel);
	mainLayout.addComponent(new HorizontalLayout());
	mainLayout.addComponent(lblConfirmDeleteMessage);
	mainLayout.addComponent(commandLayout);
	mainLayout.addComponent(new HorizontalLayout());
	mainLayout.setComponentAlignment(merchantInformationPanel, Alignment.MIDDLE_CENTER);
	mainLayout.setComponentAlignment(merchantGroupContactPersonPanel, Alignment.MIDDLE_CENTER);
	mainLayout.setComponentAlignment(lblConfirmDeleteMessage, Alignment.MIDDLE_CENTER);
	mainLayout.setComponentAlignment(commandLayout, Alignment.MIDDLE_CENTER);

	this.addComponent(this.deleteMerchantProfilePanel);
	this.setComponentAlignment(this.deleteMerchantProfilePanel, Alignment.TOP_CENTER);

	// set readonly
	this.txtMerchantId.setReadOnly(true);
	this.cbbMerchantServiceType.setReadOnly(true);
	this.cbbMCCCode.setReadOnly(true);
    }

    @Override
    public void initListener() {
	this.deleteMerchantProfileCancelButtonClickListener.setBasedComponent(this);
	this.deleteMerchantProfileDeleteButtonClickListener.setBasedComponent(this);
	this.deleteMerchantProfileCancelButtonClickListener.setAutoEnabled(true);
	this.deleteMerchantProfileDeleteButtonClickListener.setAutoEnabled(true);
	this.btnCancel.addClickListener(this.deleteMerchantProfileCancelButtonClickListener);
	this.btnDelete.addClickListener(this.deleteMerchantProfileDeleteButtonClickListener);
    }

    @Override
    public void initValidator() {

    }

    @Override
    public void initData() {
	try {
	    Long merchantId = (Long) VaadinService.getCurrentRequest().getAttribute(DELETE_MERCHANT_PROFILE_MERCHANT_ID_REQUEST_ATTRIBUTE);
	    if (merchantId == null) {
		String landing = propertyBAO.getPropertyValue("view.profile-merchant-search.path");
		this.getUI().getNavigator().navigateTo(landing);
	    } else {
		merchantProfileBean = merchantProfileBAO.getMerchantProfile(merchantId);
		if (merchantProfileBean == null || merchantProfileBean.getId() == null) {
		    String msg = this.messageBAO.getMessage("message.error.common");
		    Notification notification = new Notification("Warning", msg, Notification.Type.WARNING_MESSAGE, true);
		    notification.setDelayMsec(1000);
		    notification.show(Page.getCurrent());
		} else {

		    List<EntryBean<String, String>> masterData = masterDataBAO.selectAllMerchantProfileStatus();
		    if (masterData != null) {
			for (EntryBean<String, String> entry : masterData) {
			    this.cbbStatus.addItem(entry.getKey());
			    this.cbbStatus.setItemCaption(entry.getKey(), entry.getValue());
			}
		    }

		    masterData = masterDataBAO.selectAllMerchantProfileServiceType();
		    if (masterData != null) {
			for (EntryBean<String, String> entry : masterData) {
			    this.cbbMerchantServiceType.addItem(entry.getKey());
			    this.cbbMerchantServiceType.setItemCaption(entry.getKey(), entry.getValue());
			}
		    }

		    masterData = masterDataBAO.selectAllMerchantProfileMccCode();
		    if (masterData != null) {
			for (EntryBean<String, String> entry : masterData) {
			    this.cbbMCCCode.addItem(entry.getKey());
			    this.cbbMCCCode.setItemCaption(entry.getKey(), entry.getValue());
			}
		    }

		    masterData = masterDataBAO.selectAllCountry();
		    if (masterData != null) {
			for (EntryBean<String, String> entry : masterData) {
			    this.cbbCountryDomicile.addItem(entry.getKey());
			    this.cbbCountryDomicile.setItemCaption(entry.getKey(), entry.getValue());

			    this.cbbCountryRegion.addItem(entry.getKey());
			    this.cbbCountryRegion.setItemCaption(entry.getKey(), entry.getValue());
			}
		    }

		    if (merchantProfileBean.getLogoId() != null) {
			try {
			    FileBean resultFileBean = fileBAO.getFile(merchantProfileBean.getLogoId());
			    if (resultFileBean != null) {
				this.layoutLogo.setWidthUndefined();
				this.layoutLogo.setHeightUndefined();
				this.lblMerchantLogoHint.setVisible(false);
				this.imgMerchantLogo.setVisible(true);
				ImageStreamSource imageStreamSource = new ImageStreamSource();
				imageStreamSource.setBytes(resultFileBean.getContent());
				StreamResource imagesource = new StreamResource(imageStreamSource, "merchant-logo.png");
				this.imgMerchantLogo.setSource(imagesource);
			    }
			} catch (Exception e) {
			    e.printStackTrace();
			}
		    }
		    uiCommonUtils.setValueUIComponent(txtMerchantId, merchantProfileBean.getMerchantId());
		    uiCommonUtils.setValueUIComponent(cbbStatus, merchantProfileBean.getMerchantStatus());
		    uiCommonUtils.setValueUIComponent(txtMerchantNameEn, merchantProfileBean.getMerchantNameEn());
		    uiCommonUtils.setValueUIComponent(txtMerchantNameTh, merchantProfileBean.getMerchantNameTh());
		    uiCommonUtils.setValueUIComponent(txtCompanyNameEn, merchantProfileBean.getCompanyNameEn());
		    uiCommonUtils.setValueUIComponent(txtCompanyNameTh, merchantProfileBean.getCompanyNameTh());
		    uiCommonUtils.setValueUIComponent(cbbMerchantServiceType, merchantProfileBean.getMerchantServiceType());
		    uiCommonUtils.setValueUIComponent(cbbMCCCode, merchantProfileBean.getMccCode());
		    uiCommonUtils.setValueUIComponent(txtBusinessRegistrationNumber, merchantProfileBean.getBusinessRegNumber());
		    uiCommonUtils.setValueUIComponent(txtStatementName, merchantProfileBean.getStatementName());
		    uiCommonUtils.setValueUIComponent(cbbCountryDomicile, merchantProfileBean.getCountryDomicile());
		    uiCommonUtils.setValueUIComponent(cbbCountryRegion, merchantProfileBean.getCountryRegion());
		    uiCommonUtils.setValueUIComponent(txtBusinessAddress, merchantProfileBean.getBusinessAddress());
		    uiCommonUtils.setValueUIComponent(txtMailingAddress, merchantProfileBean.getMailingAddress());
		    uiCommonUtils.setValueUIComponent(txtUrl, merchantProfileBean.getUrl());
		    uiCommonUtils.setValueUIComponent(txtFaxNumber, merchantProfileBean.getFaxNumber());
		    uiCommonUtils.setValueUIComponent(txtTaxId, merchantProfileBean.getTaxId());
		    uiCommonUtils.setValueUIComponent(txtEnquiryNumber, merchantProfileBean.getEnquiryNumber());

		    uiCommonUtils.setValueUIComponent(txtProjectContactName, merchantProfileBean.getContact1Name());
		    uiCommonUtils.setValueUIComponent(txtProjectContactPhone, merchantProfileBean.getContact1Phone());
		    uiCommonUtils.setValueUIComponent(txtProjectContactMobile, merchantProfileBean.getContact1Mobile());
		    uiCommonUtils.setValueUIComponent(txtProjectContactEmailAddress, merchantProfileBean.getContact1Email());

		    uiCommonUtils.setValueUIComponent(txtOperationContactName, merchantProfileBean.getContact2Name());
		    uiCommonUtils.setValueUIComponent(txtOperationContactPhone, merchantProfileBean.getContact2Phone());
		    uiCommonUtils.setValueUIComponent(txtOperationContactMobile, merchantProfileBean.getContact2Mobile());
		    uiCommonUtils.setValueUIComponent(txtOperationContactEmailAddress, merchantProfileBean.getContact2Email());

		    uiCommonUtils.setValueUIComponent(txtTechnicalContactName, merchantProfileBean.getContact3Name());
		    uiCommonUtils.setValueUIComponent(txtTechnicalContactPhone, merchantProfileBean.getContact3Phone());
		    uiCommonUtils.setValueUIComponent(txtTechnicalContactMobile, merchantProfileBean.getContact3Mobile());
		    uiCommonUtils.setValueUIComponent(txtTechnicalContactEmailAddress, merchantProfileBean.getContact3Email());

		    uiCommonUtils.setValueUIComponent(txtFinancialContactName, merchantProfileBean.getContact4Name());
		    uiCommonUtils.setValueUIComponent(txtFinancialContactPhone, merchantProfileBean.getContact4Phone());
		    uiCommonUtils.setValueUIComponent(txtFinancialContactMobile, merchantProfileBean.getContact4Mobile());
		    uiCommonUtils.setValueUIComponent(txtFinancialContactEmailAddress, merchantProfileBean.getContact4Email());

		    // uiCommonUtils.clearAllUIComponentNoInputFieldWithPrefix(this);
		}
	    }

	} catch (Exception e) {
	    e.printStackTrace();
	}

	uiCommonUtils.setEnableAllUIComponent(this, false);
    }

    public MerchantProfileBean getMerchantProfileBean() {
	return merchantProfileBean;
    }

    public void setMerchantProfileBean(MerchantProfileBean merchantProfileBean) {
	this.merchantProfileBean = merchantProfileBean;
    }

    public Button getBtnDelete() {
	return btnDelete;
    }

    public Label getLblConfirmDeleteMessage() {
	return lblConfirmDeleteMessage;
    }

    public Button getBtnCancel() {
	return btnCancel;
    }

}
